package com.testfileupload.uploadimg.design;

public class DependencyInversion1 {
    public static void main(String[] args) {
        Person person = new Person();
        Email email = new Email();
        person.recive(email);

        person.recive(new WeiXing());
    }

}
interface IRecevier{
    public String getInfo();
}
class Email implements IRecevier{
    public String getInfo() {
        return "电子邮件 hello world";
    }
}
class WeiXing implements IRecevier{

    @Override
    public String getInfo() {
        return "微信 hello world";
    }
}
class Person {
    public void recive(IRecevier recevier) {
        System.out.println(recevier.getInfo());
    }
}
